<template>
    <div class="goodsdesc-container">

        <h3>{{ goodsInfo.title }}</h3>
        <hr>
        <div class="content" v-html="goodsInfo.goodsDesc"></div>
        
    </div>
</template>

<script>
//导入mui中Toast组件
import { Toast } from 'mint-ui';
export default {
    data() {
        return {
            id: this.$route.params.id,
            goodsInfo: {}
        }
    },
    methods: {
        getGoodsDesc() {
            this.$http.get('vue/getGoodsDesc/' + this.id).then(result => {
                if (result.body.status === 0) {
                    
                    this.goodsInfo = result.body.message
                    
                } else {
                    Toast('获取商品描述失败')
                }
            });
        }
    },
    created() {
        this.getGoodsDesc()
    }
}
</script>

<style lang="scss" scoped>
    .goodsdesc-container {
        h3 {
            font-size: 16px;
            color: #226aff;
            text-align: center;
            margin: 15px 0
        }

        img {
            width: 100% ;
        }
    }
</style>